home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / newsgroups / misc.19980424-19980901 / 000331_news@newsmaster….columbia.edu _Sat Aug 1 15:40:06 1998.msg < prev    next >
Internet Message Format  |  1998-08-31  |  6KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id PAA28138
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Sat, 1 Aug 1998 15:40:05 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id PAA11797
  7.     for kermit.misc@watsun; Sat, 1 Aug 1998 15:40:05 -0400 (EDT)
  8. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Re: Q: How to back up a DOS box to UNIX via Kermit?
  12. Date: 1 Aug 1998 19:40:02 GMT
  13. Organization: Columbia University
  14. Lines: 113
  15. Message-ID: <6pvqui$apt$1@apakabar.cc.columbia.edu>
  16. References: <slrn6s4abl.ha5.charlie@pc.antipope.org> <6ptdbm$49p$1@apakabar.cc.columbia.edu> <slrn6s5qo9.jc1.charlie@pc.antipope.org>
  17. NNTP-Posting-Host: watsun.cc.columbia.edu
  18. Xref: news.columbia.edu comp.protocols.kermit.misc:9042
  19.  
  20. In article <slrn6s5qo9.jc1.charlie@pc.antipope.org>,
  21. Charlie Stross <charlie @ nospam . antipope . org> wrote:
  22. : In comp.protocols.kermit.misc, fdc@watsun.cc.columbia.edu wrote:
  23. : >In article <slrn6s4abl.ha5.charlie@pc.antipope.org>,
  24. : >Charlie Stross <charlie @ nospam . antipope . org> wrote:
  25. : >: 
  26. : >: Is there some magic switch I can use to tell Kermit to create
  27. : >: intermediate directories as needed, or is there a script somewhere
  28. : >: to do just that? I want to preserve the directory structure of the
  29. : >: DOS box when making the backup ...
  30. : >: 
  31. : >You need C-Kermit 6.1 and MS-DOS Kermit 3.16 for this -- both currently
  32. : >in Beta test.  Is that what you have?  Did you read the release notes
  33. : >for both Beta versions on recursive transfers?
  34. : I've got C-Kermit 6.1.193 Beta 05 at the Linux end, and DOS Kermit 
  35. : 3.16 Alpha 5 at the Win3.1 end.  
  36. : I've checked the release notes; I don't _think_ I've missed anything, but
  37. : I still can't get it to create subdirectories on the receiving side.
  38. : send /recursive /binary *.*
  39. : from the DOS side to a UNIX server (receiving with /pathnames:relative),
  40. : still dumps all the incoming files in the same directory, instead of 
  41. : creating subdirectories for each transferred file. 
  42. It turns out that MS-DOS Kermit (unlike C-Kermit or K95) has to be told to
  43. include the pathname on outbound files when it is sending recursively;
  44. otherwise, it leaves off the pathname, which explains why all the files are
  45. ending up in the same directory on Linux.
  46.  
  47. So before starting the transfer, tell MS-DOS Kermit:
  48.  
  49.   set send pathnames relative
  50.   cd <root-of-tree-to-be-backed-up>
  51.   connect
  52.  
  53. Then, in MS-DOS Kermit's terminal screen, tell Linux C-Kermit to:
  54.  
  55.   set file type binary      ; (Transfer mode is governed by the client)
  56.   cd <root-of-backup-tree>
  57.   get /recursive *
  58.  
  59. If MS-DOS Kermit has "terminal autodownload" enabled (as it does by default),
  60. the transfer starts automatically and creates the backup tree on Linux as
  61. expected.
  62.  
  63. Note the following differences:
  64.  
  65.  1. In C-Kermit and K95, /RECURSIVE includes an implicit request for
  66.     relative pathnames, whereas MS-DOS Kermit must be told to include
  67.     or use pathnames explicitly.  We'll look into changing this in the
  68.     next MS-DOS Kermit beta edit.
  69.  
  70.  2. C-Kermit and K95 can do automatic per-file text/binary switching based
  71.     on the filename, but MS-DOS Kermit does not include this feature, and
  72.     so recursive transfers from MS-DOS Kermit should always be done in
  73.     binary mode.
  74.  
  75. : I'm mostly (a) starting kermit on the DOS box, (b) logging into the
  76. : Linux server, (c) starting C-Kermit on the Linux side, and (d) issuing
  77. : GET commands from there -- however I've also tried just sending files
  78. : from the DOS side, with the Linux kermit in receive mode.
  79. : Another thing I've tried:
  80. : CGET /recursive { cat | tar czf scratch.tar.gz - } *.*
  81. : doesn't work either. (This is GNU tar, which can read from standard input,
  82. : so I would expect kermit to get files recursively, pipe them through cat,
  83. : into tar's standard input, and tar to create an archive called
  84. : scratch.tar.gz : on the receiving machine.)
  85. You've got the operands backwards.  It's:
  86.  
  87.   cget /recursive *.* { cat | tar czf scratch.tar.gz - }
  88.  
  89. or:
  90.  
  91.   get /recursive /command *.* { cat | tar czf scratch.tar.gz - }
  92.  
  93. or:
  94.  
  95.   get /recursive /command /as:{ cat | tar czf scratch.tar.gz - } *.*
  96.  
  97. But it still will not do what you expect.  Leaving Kermit out of it for a
  98. moment...  First of all:
  99.  
  100.   cat * | gtar czf scratch.tar.gz -
  101.  
  102. makes the local copy of gtar say "gtar: can't add file - : No such file or
  103. directory", so there's some problem with the syntax.
  104.  
  105. But assuming the syntax is OK for your version gtar, you'll still wind up
  106. with an undistinguished stream of data fed into tar's standard input.  Tar
  107. can't tell it's really a series of files, and in any case would have no way
  108. to know what the filenames are, let alone where one file ends and the next
  109. one begins, so who knows what it will do?
  110.  
  111. Section 4.2.4 of ckermit2.upd describes ways to transfer directory trees
  112. using tar (plus gzip or compress if desired), for example:
  113.  
  114.   send /command:{tar cf - . | gzip -c} /as:{!gunzip -c | tar xf -}
  115.  
  116. or (in the other direction):
  117.  
  118.   get /command {!tar cf - . | gzip -c} /as:{gunzip -c | tar xf -}
  119.  
  120. But these methods won't work with MS-DOS Kermit, because it does not
  121. support file-transfer filters.  (There's only so much you do in 300K!)
  122.  
  123. - Frank